package net.esj.basic.plugins.spring.factory.xml;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import net.esj.basic.core.engine.config.PropertiesConfiguration;
import net.esj.basic.core.engine.support.MelonSupporter;
import net.esj.basic.core.engine.support.message.context.ResourceBundleMessageProvider;
import net.esj.basic.core.engine.tools.crypt.inst.impl.TwiceMD5WithAESPwdEncryptor;
import net.esj.basic.core.view.Viewer;
import net.esj.basic.core.view.tools.AgentContextStrutsImpl;
import net.esj.basic.dao.DaoProxy;
import net.esj.basic.dao.hibernate.Hibernate4SessionLocale;
import net.esj.basic.dao.hibernate.HibernateSourceLocale;
import net.esj.basic.dao.hibernate.impl.HibernateDaoImpl;
import net.esj.basic.dao.jdbc.JdbcSourceLocale;
import net.esj.basic.dao.jdbc.impl.JdbcDaoImpl;
import net.esj.basic.plugins.spring.factory.xml.parser.SupportBeanDefinitionParser.DaoSource;
import net.esj.basic.service.impl.DefaultServiceImpl;
import net.esj.basic.translate.defaults.DefaultsPoAndVoTranslator;
import net.esj.basic.utils.writer.json.JsonWriter;
import net.esj.basic.validate.defaults.DefaultJSR303Validator;

public abstract class DefaultMelonIocUtils {

	public static final Class DEFAULT_BASIC_SERVICE = DefaultServiceImpl.class;
	
	public static final String MELON_DEFAULT_SERVICE_BEAN_NAME = "net.melon.service.default";
	
	public static final Class DEFAULT_TRANSLATOR = DefaultsPoAndVoTranslator.class;
	
	public static final String MELON_TRANSLATOR_BEAN_NAME = "net.melon.core.support.translator";

	public static final Class DEFAULT_VALIDATOR = DefaultJSR303Validator.class;
	
	public static final String MELON_VALIDATOR_BEAN_NAME = "net.melon.core.support.validator";
	
	public static final Class DEFAULT_PWDENCRYPTOR = TwiceMD5WithAESPwdEncryptor.class;
	
	public static final String MELON_DEFAULT_PWDENCRYPTOR_BEAN_NAME = "net.melon.core.support.tools.pwdencryptor";
	
	public static final Class DEFAULT_MELON_SUPPORT = MelonSupporter.class;
	
	public static final Class DEFAULT_HIBERNATE_SOURCE = HibernateSourceLocale.class;
	
	public static final Class DEFAULT_HIBERNATE_SESSION_LOCALE = Hibernate4SessionLocale.class;
	
	public static final Class DEFAULT_JDBC_SOURCE = JdbcSourceLocale.class;
	
	public static final Class DEFAULT_DAO_PROXY = DaoProxy.class;
	
	public static final Set<Class> DEFAULT_DAO_SET = new HashSet<Class>();
	static{
		DEFAULT_DAO_SET .add(HibernateDaoImpl.class); 
		DEFAULT_DAO_SET .add(JdbcDaoImpl.class); 
	}
	
	public static final Map<String,DaoSource> DEFAULT_DAO_SOURCES = new HashMap<String,DaoSource>();
	static{
		DaoSource hibe = new DaoSource();
		hibe.setId("hibernate");
		hibe.setClazz(DEFAULT_HIBERNATE_SOURCE.getName());
		hibe.setDao(HibernateDaoImpl.class.getName());
		hibe.setSource(DEFAULT_HIBERNATE_SESSION_LOCALE.getName());
		DEFAULT_DAO_SOURCES.put(hibe.getId(),hibe);
		
		DaoSource jdbc = new DaoSource();
		jdbc.setId("jdbc");
		jdbc.setClazz(DEFAULT_JDBC_SOURCE.getName());
		jdbc.setDao(JdbcDaoImpl.class.getName());
		jdbc.setSourceRef("dataSource");
		DEFAULT_DAO_SOURCES.put(jdbc.getId(),jdbc);
	}
	
	public static final Class DEFAULT_AGENT_CONTEXT = AgentContextStrutsImpl.class;
	
	public static final Class DEFAULT_MESSAGE_PROVIDER = ResourceBundleMessageProvider.class;
	
	public static final Class DEFAULT_JSON_WRITER = JsonWriter.class;
	
	public static final Class DEFAULT_VIEWER = Viewer.class;
	
	public static final Class DEFAULT_CONFIGURATION = PropertiesConfiguration.class;
	
}
